﻿<%@ Page Title="Edit Parameters" Language="C#" MasterPageFile="~/Pages/admin/adminMaster.Master" AutoEventWireup="true" CodeBehind="EditParameters.aspx.cs" Inherits="WarehouseWebAPP.Pages.admin.Edit_Entities.EditParameters" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
        <asp:Label ID="ErrorLabel" runat="server" BackColor="#FFFFCC" 
                                ForeColor="Maroon" Height="24px" 
                                Text="Error: The Parameter can't be deleted from the following reason: This is a build-in Parameter." 
                                Visible="False"></asp:Label>
                                
            <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" 
        AutoGenerateRows="False" CellPadding="4" DataKeyNames="parameter_name" 
        DataSourceID="ParameterObjectDataSource" ForeColor="#333333" GridLines="None" 
        Height="50px" Width="426px" onitemdeleting="DetailsView1_ItemDeleting">
                <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <CommandRowStyle BackColor="#E2DED6" Font-Bold="True" />
                <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                <FieldHeaderStyle BackColor="#E9ECF1" Font-Bold="True" />
                <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                <Fields>
                    <asp:TemplateField HeaderText="Parameter Name" SortExpression="parameter_name">
                        <EditItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("parameter_name") %>'></asp:Label>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("parameter_name") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("parameter_name") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Parameter Value" 
                SortExpression="parameter_value">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("parameter_value") %>'></asp:TextBox>
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                        ControlToValidate="TextBox1" ErrorMessage="*"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("parameter_value") %>'></asp:TextBox>
                        </InsertItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("parameter_value") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                </Fields>
                <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                <EditRowStyle BackColor="#999999" />
                <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
            </asp:DetailsView>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="ParameterObjectDataSource" runat="server" 
        DeleteMethod="ParameterDelete" SelectMethod="GetData" 
        TypeName="WarehouseWebAPP.code.BLL.ParameterBLL" UpdateMethod="ParameterUpdate">
        <DeleteParameters>
            <asp:Parameter Name="parameter_name" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="parameter_name" Type="String" />
            <asp:Parameter Name="parameter_value" Type="String" />
        </UpdateParameters>
    </asp:ObjectDataSource>
</asp:Content>
